using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace RemoveFunction
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //byte[] resource = RemoveFunction.Properties.Resources.SQLite_Interop;
            //string path = AppDomain.CurrentDomain.BaseDirectory ;
            //if (!Directory.Exists(path)) Directory.CreateDirectory(path);
            //if (resource.Length > 0)
            //{
            //    File.WriteAllBytes(path+ "\\System.Data.SQLite.dll", resource);
            //}
            //AppDomain.CurrentDomain.AssemblyResolve += (sender, args) =>
            //{//注意WindowsFormsApplication1 这个是主程序的命名空间
            //    string resourceName = "RemoveFunction.resources." + new AssemblyName(args.Name).Name + ".dll";
            //    using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName))
            //    {
            //        Byte[] assemblyData = new Byte[stream.Length];
            //        stream.Read(assemblyData, 0, assemblyData.Length);
            //        return Assembly.Load(assemblyData);
            //    }
            //};
            Application.Run(new Form1());
            //test123
        }

        //static void loadAssemb(string name) {
        //        string resourceName = "RemoveFunction.resources." + new AssemblyName(name).Name + ".dll";
        //        using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName))
        //        {
        //            Byte[] assemblyData = new Byte[stream.Length];
        //            stream.Read(assemblyData, 0, assemblyData.Length);
        //             Assembly.Load(assemblyData);
        //        }
        //    }
        //}
    }
}
